<?php
//before everything
function lz_on_begin()
{

}

function lz_on_ready()
{
	if (LZ_MODULE == 'admin' || LZ_MODULE == 'phpdisk')
	{
		if (!$_SESSION['login_user'])
		{
			header("location:login.php?module=".LZ_MODULE);
			die;
		}
	}
}

function lz_on_controller_begin()
{
	global $config,$db;
	//fetch config 
	if (!is_array($config)) $config = array();
	
	if ($_SESSION['customer_size']) $config['default_customer_size'] = $_SESSION['customer_size'];
	function_exists('date_default_timezone_set') && @date_default_timezone_set('Etc/GMT-'.$time_zone);
}

function lz_on_template_begin()
{
	global $all_view_data; 
	$all_view_data['login_user'] = $_SESSION['login_user'];
	$all_view_data['now_time'] = date('H:i');
	$all_view_data['now_year'] = date('Y');
	$all_view_data['now_month'] = date('m');
	$all_view_data['now_day'] = date('d');
}

//after everything and before output, all output was stored in $view_html

function lz_on_end()
{
	global $view_html;
	echo $view_html;
}

?>